<include file="Member:header"/>
<script src="../Public/Js/city3.js" type="text/javascript">
</script>
<script src="__PUBLIC__/Js/jquery.validate.js" type="text/javascript">
</script>
<div id="content">
    <div class="flow-steps">
        <ol class="num5">
            <li class="done current-prev">
                <span class="first">1. 查看购物车</span>
            </li>
            <li class="current">
                <span>2. 输入订单信息</span>
            </li>
            <li class="last">
                <span>3. 完成订单</span>
            </li>
        </ol>
    </div>
    <!--end flow-steps-->
    <div class="index-pro mb">
        <div class="p_title">
            <h2 class="tith f1">确认商品信息</h2>
        </div>
    </div>
    <!--end index-pro--><include file="b_cart"/><!--end cart-->
    <div class="index-pro mb">
        <div class="p_title">
            <h2 class="tith f2">填写收货人信息</h2>
        </div>
    </div>
    <!--end index-pro-->
    <form action="{:U('Orderform/create')}" method="POST" id="order_form" onsubmit="return subOrder()">
        <volist name="datalist" id="vo">
            <input type="hidden" name="cart_id[]" value="{$vo.cart_id}" id="cart_input_{$vo.cart_id}">
        </volist>
        <ul class="elem_form">
            <li>
                <span class="label_like">收货人姓名：</span>
                <input name="consignee" type="text" class="input_1  required" value=""/><span class="red">&nbsp;*</span>
            </li>
            <li>
                <span class="label_like">所在地区：</span>
                <select id="Search_1" onchange="ChangeSelect(this.value,'Search_2','',ArrCity3)" style="width: 150px" name="province">
                </select>省
                <select id="Search_2" onchange="ChangeSelect(this.value,'Search_3','',ArrCity3)" style="width: 150px" name="city">
                </select>
                市
                <select id="Search_3" onchange="" style="width: 150px" name="county">
                </select>区<span class="red">*</span>
                <script type="text/javascript">
                    ChangeSelect('0', 'Search_1', '0', ArrCity3);
                    //ChangeSelect('370000','Search_2','370200',ArrCity3);
                    //$('#Search_3').val('370202');
                </script>
            </li>
            <li>
                <span class="label_like">街道地址：</span>
                <textarea class="text_a_2 required" name="consignee_addr"></textarea>
                <span class="red">&nbsp;*</span>
            </li>
            <li>
                <span class="label_like">邮政编码：</span>
                <input name="zipcode" type="text" class="input_1 required" value=""/>
				<span class="red">&nbsp;*</span>
            </li>
            <li>
                <span class="label_like">收货人手机：</span>
                <input name="consignee_phone" type="text" class="input_1 required phone" value=""/><span class="red">&nbsp;*手机号和电话必填一项</span>
            </li>
            <li>
                <span class="label_like">固定电话：</span>
                <input name="consignee_tel" type="text" class="input_1" value=""/>
				<span class="red">&nbsp;*</span>
            </li>
            <li>
                <span class="label_like">收货人是谁：</span>
                <input name="is_self" type="radio" value="1" onclick="domSelfli(1);" checked/> 我自己<input name="is_self" type="radio" value="0" onclick="domSelfli(0);"/>他人
            </li>
            <li class="shr-other" style="display:none;">
                <div class="tips-other">
                    <p class="icon">
                        请输入您自己的姓名和手机号，以便订单有问题时，我们可以随时联
                    </p>
                    <p>
                        <strong class="bk_element">姓&nbsp;&nbsp;名：</strong>
                        <input name="self_name" type="text" class="input_2" value="{$memberinfo.content.realname}"/>
                    </p>
                    <p>
                        <strong class="bk_element">手机号：</strong>
                        <input name="self_phone" type="text" class="input_2" value="{$memberinfo.content.mobile}"/>
                    </p>
                </div><!--end tips-other-->
            </li>
        </ul>
        <div class="index-pro mb">
            <div class="p_title">
                <h2 class="tith f3">选择付款方式</h2>
            </div>
        </div>
        <!--end index-pro-->
        <div class="order_info" style="margin:0;padding:0;">
            <ul class="user_info ml">
                <volist name="sets.pay_type" id="svo">
                    <li>
                        <div class="bank">
                            <input name="pay_type" type="radio" value="{$key}"
                            <eq name="key" value="1">
                                checked="checked"
                            </eq>
                            />{$svo}
                        </div>
                        <span class="sm">
                            <eq name="key" value="1">
                                支付宝担保交易，货到确认付款
                            </eq>
                            <eq name="key" value="2">
                                财付通担保交易，货到确认付款
                            </eq>
                            <eq name="key" value="3">
                                支持国内18家银行借记卡和信用卡的在线支付
                            </eq>
                            <eq name="key" value="4">
                                提供中国银行、建设银行、工商银行、农业银行和交通银行的汇款/转账付款
                            </eq>
                            <eq name="key" value="5">
                                提供邮局的按地址汇款付款方式
                            </eq>
                        </span>
                    </li>
                </volist>
                <li class="shr-other">
                    <div class="tips-other">
                        <p class="icon">
                            货到付款结算方式提醒
                        </p>
                        <p class="pl">
                            <input name="" type="radio" value="" />5.00元   江浙沪地区  加收5元货到付款服务费
                        </p>
                        <p class="pl">
                            <input name="" type="radio" value="" />10.00元  除江浙沪外的其他地区  加收10元货到付款服
                        </p>
                    </div><!--end tips-other-->
                </li>
            </ul>
            <div class="g_order">
                <input name="" type="submit" value="生成订单" class="order_but pl2" />
            </div>
        </div><!--end order_info-->
    </form>
</div>
<script language="JavaScript">
    $(document).ready(function(){
        $("#order_form").validate({
    	        rules: {
    	            consignee: {
    	                required: true
    	            },
    	            zipcode: {
    	                required: true,
    	                minlength: 6,
    	                alphanumeric: true
    	            },
    	            consignee_phone: {
    	                required: true
    	            }
    	        },
    	        messages: {
    	            consignee: {
    	                required: '请输入收货人姓名。',
    	            },
    	            zipcode: {
    	                required: '请输入邮政编码。',
    	            },
    	            consignee_phone: {
    	                required: '请输入收货人手机。',
    	            },
    	            consignee_addr: {
    	                required: '请输入街道地址。',
    	            }
    	        },
    	        errorPlacement: function(error, element){
    	            element.parent("li").find("span.red").html(error);
    	        }
    	    });
    	});
    	function subOrder(){
    		if($("#order_form").valid()){
    			return true;
    		}
    		return false;
    	}
    	function removeCart(cart_id){
    		postData('{:U('Cart/del')}','cart_id='+cart_id,removeCartok);
    	}
    	function removeCartok(jdata){
    		if(jdata.status){
    			$('#cart_tr_'+jdata.data).remove();
    			$('#cart_input_'+jdata.data).remove();
    			alert(jdata.info);
    			 go2();
    		}  else{
    			alert(jdata.info);	
    		}
    	}
    	function domSelfli(isop){
    		if(isop == 1){
    			$('.shr-other').hide().removeClass('required');
    		}else{
    			$('.shr-other').show().addClass('required');
    		}
    	}
</script>
<!--footer start-->
<div id="waitting_wbox" style="display:none;">
    <div class="wait_box">
        <p class="pass-mem">
            正在加载中...
        </p>
    </div>
</div>
<include file="Layout:footer"/>